#ifndef __WEBSERVER_H__
#define __WEBSERVER_H__



#include "common.h"
#include "configParse.h"
#include "log.h"
#include "httpParse.h"
#include "io.h"
#include "utils.h"
#include "connpool.h"

int webServerInit(struct webServerCtx **ctx, int iotype);
void webServerDeinit(struct webServerCtx *ctx);
void * workerThreadRun(void *arg);
int webServerRun(struct webServerCtx *ctx);
int createListenSocket(struct webServerCtx *ctx);
int mainThreadHandleEvent(struct webServerCtx *ctx, int evCount);
int getANewConnection(struct webServerCtx **ctx);
int workerThreadHandleEvent(struct workerPthread_ctx *workctx, int evcount);
int getListenThreadMsg(struct workerPthread_ctx *ctx);
int sendSystemMsg(struct webServerCtx *ctx, struct systemmsg_st * msg);
int handleHttpEvent(int index, struct workerPthread_ctx *workctx);
void signalHandle(int signo);
int registerSignalHandle(int isListenThreadFlag);
int readHttpRequest(struct workerPthread_ctx *workctx, int fd);
#endif 
